<?php

function dx_touxiang($uid) {

    $data2 = \Phpcmf\Service::M()->db->table('member_data')->where('id', $uid)->get()->getRowArray();
	if($data2['is_avatar']==1){
		$touxiang = dr_avatar($uid);
	} else if($data2['is_avatar']==0){
		$weixin_touxiang = \Phpcmf\Service::M()->db->table('member_oauth')->where('uid', $uid)->get()->getRowArray();
		if($weixin_touxiang){
			$touxiang = $weixin_touxiang['avatar'];
		} else {
			$touxiang = dr_avatar($uid);
		}
	}
    return $touxiang;
}

